<%@ page contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8" %>
<%@ page import="com.yaodian100.core.common.utils.ServerValue" %>
<%@ page import="java.math.BigDecimal"%>
<%@ taglib uri="http://www.yaodian100.com/jsp/yaodian100" prefix="yaodian100" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt" %>
<%@ taglib uri="/WEB-INF/tld/mallutil.tld" prefix="mu" %>
<%@ taglib uri="/WEB-INF/tld/pageutil.tld" prefix="pu" %>
<%@ taglib uri="/WEB-INF/tld/importTag.tld" prefix="importTag" %>
<link rel="stylesheet" href="/css/table_sorter.css" type="text/css" id="" media="print, projection, screen" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-CN" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<c-rt:set var="imgDomain" value="<%=ServerValue.getImgDomain()%>" />
<c-rt:set var="hostName" value="<%=ServerValue.getFrontHostname()%>" />
<c-rt:set var="frontendContextPath" value="<%=ServerValue.getFrontContextPath()%>" />
<c-rt:set var="frontHtmlPath" value="<%=ServerValue.getFrontApachePath()%>" />
<c-rt:set var="serverName" value="<%=request.getServerName()%>" />

<c-rt:set var="shareLinkPath" value="${hostName}${frontendContextPath}/tuangou/activity.do" />
<c-rt:set var="happyText" value="耀团购－享受诚信满意的购物体验" />
<!--[if lt IE 7]>
<script type="text/javascript" src="/js/supersleight-min.js"></script>
<![endif]-->
    <!-- content start -->
    <c-rt:if test="${fn:length(historyTuangouList)==0}">
	    <div class="content faq-page">
			<div class="page-box"></div>
			<div class="pd-big idx-big no-record">
				 <div class="pd-show">
		         	  <h1>&nbsp;</h1>
		         	  <h1>暂时还没有相关的团购商品资料。</h1>
		              <div class="faq-block">
		              	<p>亲，您可以点击 “今日团购” ，浏览由耀点100为您准备的热门团购商品！</p>
		              	<p><a href="/" title="耀点100首页">耀点100首页</a>&nbsp;|&nbsp;<a href="/ecmall/member/myyaodian.do" title="我的耀点100">我的耀点100</a></p>  
		              </div>
				 </div>
				 <img class="cf-ft" src="/images/none.gif">
			</div>
	     </div>
    </c-rt:if>
     <c-rt:if test="${fn:length(historyTuangouList)>0}">
		     <div class="content">
		     <p class="fl-rt">共${announcementSize}笔： ${pager.currentPage+1}/${pager.pageSize}
			    		<c-rt:choose><c-rt:when test="${pager.currentPage==0}">
							<span >&lt; 上一页</span> |
						</c-rt:when><c-rt:otherwise>
							<a href="${frontContentPath}/ecmall/tuangou/history.do?pager.currentPage=${pager.currentPage-1}" class="a-togo">&lt; 上一页</a> |
						</c-rt:otherwise></c-rt:choose>
						<c-rt:choose><c-rt:when test="${pager.currentPage == pager.pageSize-1}">
							<span>下一页 &gt;</span>
						</c-rt:when><c-rt:otherwise>
							<a href="${frontContentPath}/ecmall/tuangou/history.do?pager.currentPage=${pager.currentPage+1}" class="a-togo">下一页 &gt;</a>
						</c-rt:otherwise></c-rt:choose>
						</p>
		      	<!-- 商品主檔 -->
		        <p class="only3month">※ 仅显示三个月内团购商品 </p>
		        
		        		<c-rt:forEach items="${historyTuangouList}" var="historyTuangou" varStatus="status">
					
							<div class="pd-little">
					       	 <div class="pd-show">
					        	  <h1><span>精采回顾：</span><a href="${frontendContextPath}/tuangou/product.do?tuangouId=${historyTuangou.tuangouId}" target="_blank">${historyTuangou.promoteName}</a></h1>
					              <h2><span>商品名称：</span>${getHistoryPrdMap[historyTuangou.productId].productName}</h2>
					               <c-rt:choose>
									 <c-rt:when test="${invMap[historyTuangou.productId] > 0}">
										<a class="pd-img" href="${frontendContextPath}/tuangou/product.do?tuangouId=${historyTuangou.tuangouId}" target="_blank"> <img src="${imgDomain}/PImg/${pu:substring(historyTuangou.productId,0,4)}/${historyTuangou.productId}/${historyTuangou.productId}_rm225.jpg" onError="this.src='${imgDomain}/PImg/blank_r225.gif'" title="${getHistoryPrdMap[historyTuangou.productId].productName}" width="170" height="225" /></a>
									</c-rt:when>
									<c-rt:otherwise>
										<div class="pd-img">
											<img class="icon-sale-out" src="/images/tuangou/icon_saleout.png" />
										<img src="${imgDomain}/PImg/${pu:substring(historyTuangou.productId,0,4)}/${historyTuangou.productId}/${historyTuangou.productId}_rm225.jpg" onError="this.src='${imgDomain}/PImg/blank_r225.gif'" title="${getHistoryPrdMap[historyTuangou.productId].productName}" width="170" height="225" />
					               
										</div>
									</c-rt:otherwise>
								</c-rt:choose>
					               
					               <c-rt:choose>
										<c-rt:when test="${fn:indexOf(historyTuangou.price,'.')!=-1}">
											<c-rt:set var="bPrice" value="${fn:substring(historyTuangou.price,0,fn:indexOf(historyTuangou.price,'.'))}" />
											<c-rt:set var="sPrice" value="${fn:substring(historyTuangou.price,fn:indexOf(historyTuangou.price,'.'),-1)}" />
										</c-rt:when>
										
										<c-rt:otherwise>
											<c-rt:set var="bPrice" value="${historyTuangou.price}" />
											<c-rt:set var="sPrice" value="" />
										</c-rt:otherwise>
									</c-rt:choose>	
					              
					              <div class="left-area">
					                  <div class="price">
					                        <p>￥<em>${bPrice}</em>${sPrice}
						                     <c-rt:choose>   	
						                     <c-rt:when test="${invMap[historyTuangou.productId] > 0}">
						                        <a href="${frontendContextPath}/tuangou/product.do?tuangouId=${historyTuangou.tuangouId}" target="_blank" class="btn-go wd-3">
													去看看
												</a>
											</c-rt:when>
											<c-rt:when test="${invMap[historyTuangou.productId]  <= 0}">
												<span class="sell-out">抢购一空</span>
											</c-rt:when>
											<c-rt:otherwise>
												<span class="sell-out">抢购结束</span>
											</c-rt:otherwise>
											</c-rt:choose>
											</p>
					                        <span><s>￥${getHistoryPrdMap[historyTuangou.productId].listPrice}</s></span>
					                        <span><b><fmt-rt:formatNumber value="${discountMap[historyTuangou.productId]}" pattern="#0.#" />折</b></span>
					                        <span>￥${getHistoryPrdMap[historyTuangou.productId].listPrice-historyTuangou.price}</span>
					                  </div>
					                  
					                <c-rt:choose>  
					               	<c-rt:when test="${invMap[historyTuangou.productId] > 0}">    
						                   <p class="txt-L txt-rd"><strong>${historyTuangou.orderQty-historyTuangou.cancelQty}</strong>人已购买</p>
						               	   <p class="txt-m">數量有限，先到先得</p>
						               	   
					               	  </c-rt:when> 
					               	  <c-rt:when test="${invMap[historyTuangou.productId] <= 0}">
												<p class="txt-L txt-rd"><strong>${historyTuangou.orderQty-historyTuangou.cancelQty}</strong>人已购买</p>
											<c-rt:if test="${getHistoryPrdMap[historyTuangou.productId].productType==1 && getHistoryPrdMap[historyTuangou.productId].expectShipDate>historyTuangou.endDate}">
												<p>预计<strong class="txt-rd"><fmt-rt:formatDate value="${getHistoryPrdMap[historyTuangou.productId].expectShipDate}" pattern="yyyy-MM-dd" /></strong>出货</p>
											</c-rt:if>
											 <p class="txt-m">&nbsp;</p>
									</c-rt:when>
									
									<c-rt:otherwise>
												<p class="txt-L txt-rd"><strong>${historyTuangou.orderQty-historyTuangou.cancelQty}</strong>人已购买</p>
												<p>數量有限，先到先得</p>
									</c-rt:otherwise> 
					               	 </c-rt:choose>  
					              </div> 
					           </div>
					           <img src="/images/none.gif" class="cf-ft" />
					        </div>
						</c-rt:forEach>			
							 <p class="page-change">
					        <span><yaodian100:pager10 pagerObj="${pager}" link="${frontContentPath}/ecmall/tuangou/history.do"/></span>
					      </p>
		        <!-- 商品主档 -->
		        
		     </div>
	 </c-rt:if>
     <!-- content end -->
     <!-- sidebar start -->
      <div class="sdbar">
     	<div class="show-box">
		<importTag:static path="${frontHtmlPath}/tuangou/com/tips.html" />
	</div>
	<div class="show-box">
		<importTag:static path="${frontHtmlPath}/tuangou/com/faq.html" />
	</div>
	<div class="show-box">
		<importTag:static path="${frontHtmlPath}/tuangou/com/blogs.html" />
	</div>
     </div>
     <!-- sidebar end -->
      